package com.etone.thread;

public class ThreadAlive {

	public static void main(String[] args) {
		Thread t1 = new Thread(new Runnable(){

			@Override
			public void run() {
				for(int k = 0 ;k<500;k++){
					System.out.println(k);
				}
				System.out.println("``````````t1 is over!");
			}
			
		});
		t1.start();
		Thread t2 = new Thread(new Runnable(){
			
			@Override
			public void run() {
				for(int k = 0 ;k<5000;k++){
					System.out.println(k);
				}
				System.out.println("``````````t2 is over!");
			}
			
		});
		t2.start();
		Thread t3 = new Thread(new Runnable(){
			
			@Override
			public void run() {
				for(int k = 0 ;k<10000;k++){
					System.out.println(k);
				}
				System.out.println("``````````t3 is over!");
			}
			
		});
		t3.start();
		
		while(true){
			if(!t1.isAlive() & !t2.isAlive() & !t3.isAlive()){
				System.out.println("SSSSSSSSSSSSS");
				break;
			}
		}
	}
	
}
